<?php
$datauser = $this->Session->read('Auth.User');
// debug($datauser['username']);
$username = $datauser['username'];
?>
<!DOCTYPE html>
<html>
    <head>
        <?php echo $this->Html->charset(); ?>
        <title> <?php echo $title_for_layout; ?>
        </title>
        <?php echo $this->Html->meta('icon');

            echo $this->Html->css(array(
                'cake.org',
                'style',
                'prettyPhoto',
                'tipsy',
                'camera',
                'jcarousel',
            ));
            echo $this->Html->script(array(
                'jquery-1.8.2.min',
                'css3-mediaqueries',
                'modernizr-1.7.min',
                'jquery.prettyPhoto',
                'jquery.tipsy',
                'jquery.easing.1.3',
                'camera.min',
                'jquery.jcarousel.min',
                'jquery-hover-effect',
                'jquery.hoverIntent.minified',
                'jquery.dcmegamenu.1.3.3',
                'jquery.tweet',
                'jquery.quovolver',
                'custom',
                'accordion',
                'jquery.catslider',
                'jquery.isotope.min',
                'jquery.jqzoom-core',
                'jquery.rating',
                'modernizr.custom.63321',
                'organictabs.jquery',
                'productview',
            ));
            echo $this->fetch('meta');
            echo $this->fetch('css');
            echo $this->fetch('script');
        ?>
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700|Arvo:400,400italic,700,700italic' rel='stylesheet' type='text/css'>

        <script type="text/javascript">
            $(document).ready(function($) {
                $('#mega-menu-3').dcMegaMenu({
                    rowItems : '2',
                    speed : 'fast',
                    effect : 'fade'
                });
                $('#mega-menu-4').dcMegaMenuCategory({
                    rowItems : '2',
                    speed : 'fast',
                    effect : 'fade'
                });
            });
        </script>

    </head>
    <body>
        <header>
            <div class="content-main">
                <div id="top">
                    <?php  if($this->Session->read('Auth.User')){ echo "<span>Hello! $username </span>";}  ?>
                    <div>
                        <p>
                   <?php  echo __('Languae :')?>
                   <?php echo $this->Html->image('flag/flag_English.gif',array('alt'=>'English')) ?>
                    &#160;
                   <?php echo $this->Html->image('flag/flag-VN.png',array('alt'=>'VietNam"')) ?>
                        </p>

                    </div>
                </div><!--end:top-->
                <div id="top2">
                    <ul class="myaccountmenu">
                        <li><?php echo $this->Html->link(__('Cart'), '#') ?> </li>
                        <li><?php echo $this->Html->link(__('Order'), '#') ?> </li>
                         <?php if($this->Session->read('Auth.User')){ ?>
                        <li><?php echo $this->Html->link(__('Account'), array('controller'=>'users', 'action'=>'view', $datauser['id'])) ?> </li>
                        <li><?php echo $this->Html->link(__('Logout'), array('controller'=>'users', 'action'=>'logout')) ?> </li>
                        <?php }else{?>
                        <li><?php echo $this->Html->link(__('Register'), array('controller'=>'users', 'action'=>'add')) ?> </li>
                        <li class="login"><?php echo $this->Html->link(__('Login'), '#login-box', array('class'=>'last login-window')) ?> </li>
                         <?php  } ?>
                    </ul>
                    <div id="login-box" class="login-popup">
                       <?php echo $this->Html->link($this->Html->image("process-stop.png", array("alt" => "Close", 'class'=>'btn_close', 'title'=>'Close Window')),'#', array('escape' => false, 'class'=>'close'));?>
                       <?php echo $this->Session->flash('auth'); ?>
                       <?php
                        echo $this->Form->create('User', array(
                                        'url' => array(
                                        'controller' => 'users',
                                        'action' => 'login'
                                        ),
                                        'type' => 'post',
                                        'class' => 'signin'
                                        ));
                        ?>
                            <fieldset class="textbox">
                                    <?php echo $this->Form->input('username', array('placeholder' => 'username', 'autocomplete'=>'on', 'label'=>array('class'=>'username')));
                                     echo $this->Form->input('password', array('placeholder' => 'password', 'autocomplete'=>'on', 'label'=>array('class'=>'password')));?>
                                <!-- <button class="submit button" type="button">
                                    Sign in
                                </button> -->
                                <!-- <p>
                                    <a class="forgot" href="#">Forgot your password?</a> / <a class="register" href="#">Create an Account</a>
                                </p> -->
                            </fieldset>

                       <?php echo $this->Form->end('Login'); ?>
                    </div>

                    <div id="demo-header">
                        <a id="cart-link" href="#cart" title="Cart">2 Items - 300VND</a>
                        <div id="cart-panel">
                            <div class="item-cart">
                                <table>
                                    <tbody>
                                        <tr>
                                            <td class="image"><a href="#"><img width="60" height="60" src="img/products/product-thumb-1.jpg" alt="product" title="product"></a></td>
                                            <td class="name"><a href="#">Women's Saucony</a></td>
                                            <td class="quantity">x1</td>
                                            <td class="total">600VND</td>
                                            <td class="remove"><i class="icon-remove"></i></td>
                                        </tr>
                                        <tr>
                                            <td class="image"><a href="#"><img width="60" height="60" src="img/products/product-thumb-1.jpg" alt="product" title="product"></a></td>
                                            <td class="name"><a href="#">Women's Saucony</a></td>
                                            <td class="quantity">x1</td>
                                            <td class="total">600VND</td>
                                            <td class="remove"><i class="icon-remove "></i></td>
                                        </tr>
                                    </tbody>
                                </table>
                                <table>
                                    <tbody>
                                        <tr>
                                            <td class="textright"><b>Sub-Total:</b></td>
                                            <td class="textright">900VND</td>
                                        </tr>
                                        <tr>
                                            <td class="textright"><b>Eco Tax (-2.00):</b></td>
                                            <td class="textright">200VND</td>
                                        </tr>
                                        <tr>
                                            <td class="textright"><b>VAT (10%):</b></td>
                                            <td class="textright">200VND</td>
                                        </tr>
                                        <tr>
                                            <td class="textright"><b>Total:</b></td>
                                            <td class="textright">1000VND</td>
                                        </tr>
                                    </tbody>
                                </table>
                                <div class="buttoncart">
                                    <a href="cart.html">Xem giỏ hàng</a>
                                    <a href="#">Đặt hàng</a>
                                </div>
                            </div>
                        </div><!-- /login-panel -->
                    </div><!-- /demoheader -->
                </div><!--end:top2-->
                <div id="top3">
                    <h1 class="logo"><?php echo $this->Html->link (__('Noithat'), array('controller' => 'Pages', 'action'=>'home' )) ?> </h1>
                </div><!--end:top3-->
                <div id="top4">
                    <form action="#" method="post" class="search_bar">
                        <fieldset>
                            <input type="text" name="search" class="search" value="Enter a keywords..." onBlur="if (this.value == ''){this.value = 'Enter a keywords...'; }" onFocus="if (this.value== 'Enter a keywords...') {this.value = ''; }" />
                            <label>
                                <select>
                                    <option selected>All </option>
                                    <option>Loai 1</option>
                                    <option>Loai 2</option>
                                </select> </label>
                            <input type="submit" name="submit" value="Search" class="submit" />
                        </fieldset>
                    </form>
                </div><!--end:top4-->
            </div>
        </header>

        <div id="page_wrap">

            <div id="container">
                <nav>
                    <ul id="mega-menu-3" class="mega-menu">
                    <li class="first"><?php echo $this->Html->link(__('Home'), array('controller'=>'pages', 'action'=>'home'))?></li>

                        <li><?php echo $this->Html->link(__('Manufactory'),'#') ?>
                            <ul>
                                <li><a href="#">Women's Clothing</a>
                                    <ul class="menu-1">
                                        <li><a href="http://html5awesome.com/themeforest/shopymart/newarrival.html">New Arrival</a></li>
                                        <li><a href="http://html5awesome.com/themeforest/shopymart/sale.html">On Sale</a></li>
                                        <li><a href="brands.html">Brands</a></li>
                                    </ul>
                                    <ul>
                                        <li><a href="#">Coats</a></li>
                                        <li><a href="#">Dresses &amp; Skirts</a></li>
                                        <li><a href="#">Hoodies &amp; Sweatshirts</a></li>
                                        <li><a href="#">Jackets</a></li>
                                        <li><a href="#">Pants &amp; Shorts</a></li>
                                        <li><a href="#">Jeans</a></li>
                                    </ul></li>
                                <li><a href="http://html5awesome.com/themeforest/shopymart/clothing">Men's Clothing</a>
                                    <ul class="menu-1">
                                        <li><a href="http://html5awesome.com/themeforest/shopymart/newarrival.html">New Arrival</a></li>
                                        <li><a href="http://html5awesome.com/themeforest/shopymart/sale.html">On Sale</a></li>
                                        <li><a href="brands.html">Brands</a></li>
                                    </ul>
                                    <ul>
                                        <li><a href="#">Coats</a></li>
                                        <li><a href="#">T-Shirts</a></li>
                                        <li><a href="#">Hoodies &amp; Sweatshirts</a></li>
                                        <li><a href="#">Jackets</a></li>
                                        <li><a href="#">Pants &amp; Shorts</a></li>
                                        <li><a href="#">Jeans</a></li>
                                    </ul></li>
                            </ul></li>
                        <li> <?php echo $this->Html->link(__('News'),'#') ?> </li>
                        <li> <?php echo $this->Html->link(__('Design'),'#') ?> </li>
                        <li> <?php echo $this->Html->link(__('Contact'),'#') ?> </li>
                        <li> <?php echo $this->Html->link(__('About'),'#') ?> </li>
                    </ul>
                </nav><!--end:grey-->
                <div class="content-wrap">

                    <div id="content">
                        <?php echo $this->Session->flash(); ?>
                        <?php echo $this->fetch('content'); ?>
                    </div>

                </div><!--end:content-wrap-->
            </div><!--end:container-->
        </div><!--end:page_wrap-->
        <footer>
            <div class="content-main">
                <div class="content-wrap">
                    <div class="one-fourth first">
                        <h4>Information</h4>
                        <ul>
                            <li> <?php echo $this->Html->link(__('About Us'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Information'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Privacy Policy'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Terms'),'#') ?> </li>
                        </ul>
                    </div>
                    <div class="one-fourth">
                        <h4>Customer Services</h4>
                        <ul>
                            <li> <?php echo $this->Html->link(__('Contact Us'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Shipping Returns'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Secure Shopping'),'#') ?> </li>
                        </ul>
                    </div>
                    <div class="one-fourth">
                        <h4>Extras</h4>
                        <ul>
                            <li> <?php echo $this->Html->link(__('Brands'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Gift Vouchers'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Affiliates'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Special'),'#') ?> </li>
                        </ul>
                    </div>
                    <div class="one-fourth">
                        <h4>My Account</h4>
                        <ul>
                            <li> <?php echo $this->Html->link(__('My Account'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Order History'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Wishlist'),'#') ?> </li>
                            <li> <?php echo $this->Html->link(__('Newsletter'),'#') ?> </li>
                        </ul>
                    </div>
                </div>
                <div class="content-wrap">
                    <div style="clear:both; display:block;" class="social-wrap"></div>
                    <ul class="social">
                         <li><?php  echo $this->Html->link($this->Html->image("social-icon-facebook.png", array("alt" => "Facebook")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'Facebook'));  ?></li>
                         <li><?php  echo $this->Html->link($this->Html->image("social-icon-dribbble.png", array("alt" => "Dribbble")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'Dribbble'));  ?></li>
                         <li><?php  echo $this->Html->link($this->Html->image("social-icon-facebook.png", array("alt" => "Flickr")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'Flickr'));  ?></li>
                         <li><?php  echo $this->Html->link($this->Html->image("social-icon-facebook.png", array("alt" => "Pinterest")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'Pinterest'));  ?></li>
                         <li><?php  echo $this->Html->link($this->Html->image("social-icon-facebook.png", array("alt" => "Twitter")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'Twitter'));  ?></li>
                        <li><?php  echo $this->Html->link($this->Html->image("social-icon-facebook.png", array("alt" => "RSS")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'RSS'));  ?></li>
                    </ul>
                    <ul class="payment">
                        <li><?php  echo $this->Html->link($this->Html->image("payment-icon-paypal.png", array("alt" => "Paypal")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'Paypal'));  ?></li>
                        <li><?php  echo $this->Html->link($this->Html->image("payment-icon-ae.png", array("alt" => "American Express")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'American Express'));  ?></li>
                        <li><?php  echo $this->Html->link($this->Html->image("payment-icon-discover.png", array("alt" => "Discover")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'Discover'));  ?></li>
                        <li><?php  echo $this->Html->link($this->Html->image("payment-icon-mastercard.png", array("alt" => "Master Card")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'Master Card'));  ?></li>
                        <li><?php  echo $this->Html->link($this->Html->image("payment-icon-visa.png", array("alt" => "Visa")),'#', array('escape' => false, 'class'=>'tip', 'title'=>'Visa'));  ?></li>
                    </ul>
                    <p style="clear:both; display:block;">
                        &copy; 2013 <?php echo $this->Html->link(__('Noithat'), '#') ?> , All Rights Reserved.
                    </p>
                </div>
            </div>
        </footer>

        <script type="text/javascript">
            //------JCAROUSEL-------------
            function mycarousel_initCallback(carousel) {
                // Disable autoscrolling if the user clicks the prev or next button.
                carousel.buttonNext.bind('click', function() {
                    carousel.startAuto(0);
                });
                carousel.buttonPrev.bind('click', function() {
                    carousel.startAuto(0);
                });
                // Pause autoscrolling if the user moves with the cursor over the clip.
                carousel.clip.hover(function() {
                    carousel.stopAuto();
                }, function() {
                    carousel.startAuto();
                });
            };
            jQuery(document).ready(function() {
                jQuery('#mycarousel, #mycarouselnew').jcarousel({
                    auto : 0,
                    wrap : 'last',
                    initCallback : mycarousel_initCallback
                });
            });
        </script>
        <script type="text/javascript">
            jQuery(function($) {
                $(".tweet").tweet({
                    join_text : "auto",
                    username : "html5awesome",
                    avatar_size : 48,
                    count : 3,
                    auto_join_text_default : " we said, ",
                    auto_join_text_ed : " we ",
                    auto_join_text_ing : " we were ",
                    auto_join_text_reply : " we replied ",
                    auto_join_text_url : " we were checking out ",
                    loading_text : "loading tweets..."
                });
            });
        </script>
        <script type="text/javascript">
            ( function(d, s, id) {
                    var js, fjs = d.getElementsByTagName(s)[0];
                    if (d.getElementById(id))
                        return;
                    js = d.createElement(s);
                    js.id = id;
                    js.src = "../../../connect.facebook.net/en_US/all.js#xfbml=1";
                    fjs.parentNode.insertBefore(js, fjs);
                }(document, 'script', 'facebook-jssdk'));
        </script>
    </body>
</html>
